workspace(name = "testing_java")

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

local_repository(
    name = "tink_java",
    path = "../../java_src",
)

load("@tink_java//:tink_java_deps.bzl", "TINK_MAVEN_ARTIFACTS", "tink_java_deps")

tink_java_deps()

load("@tink_java//:tink_java_deps_init.bzl", "tink_java_deps_init")

tink_java_deps_init()

# Release from 2022-10-19.
http_archive(
    name = "io_grpc_grpc_java",
    sha256 = "992f757b022bb40d2db07a4924f169c0abacbbddcae8f32edb99921683fdffe9",
    strip_prefix = "grpc-java-1.50.2",
    url = "https://github.com/grpc/grpc-java/archive/v1.50.2.tar.gz",
    # Replaces `protobuf_java_lite` with `protobuf_javalite`. Protobuf
    # does not expose a `protobuf_java_lite` target.
    patches = ["@testing_java//third_party:io_grpc_grpc_java.diff"],
    patch_args = ["-p1"],
)

load("@rules_jvm_external//:defs.bzl", "maven_install")
load("@io_grpc_grpc_java//:repositories.bzl", "IO_GRPC_GRPC_JAVA_ARTIFACTS", "IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS", "grpc_java_repositories")

grpc_java_repositories()

maven_install(
    artifacts = TINK_MAVEN_ARTIFACTS +
      IO_GRPC_GRPC_JAVA_ARTIFACTS + [
        "args4j:args4j:2.33",
      ],
    generate_compat_repositories = True,
    override_targets = IO_GRPC_GRPC_JAVA_OVERRIDE_TARGETS,
    repositories = [
        "https://maven.google.com",
        "https://repo1.maven.org/maven2",
    ],
)

load("@maven//:compat.bzl", "compat_repositories")

compat_repositories()
